home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / x-parsh.tip < prev    next >
Text File  |  1993-09-15  |  2KB  |  65 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 12.1.3, p. II-108.
  16. % Original source in file "par3.TEX", starting line 176.
  17. \wlog{L: "x-parsh.tip" ["par3.TEX," l. 176, p. II-108]}%
  18. % This file DOES belong to format "texip."
  19. \InputD{doloop.tip}
  20. \catcode`\@ = 11
  21. \newcount\X@ParShapeCountA
  22. \newcount\X@ParShapeCountB
  23. \newcount\X@ParShapeCountC
  24. \newdimen\X@ParShapeDimenA
  25. \newdimen\X@ParShapeDimenB
  26. \def\XParShape{%
  27.     \def\X@ParShapeCollect{ }%
  28.     \X@ParShapeCountC = 0
  29.     \afterassignment\X@ParShapeB
  30.     \X@ParShapeCountA
  31. }
  32. \def\X@ParShapeB{%
  33.     \ifnum\X@ParShapeCountA = 0
  34.         \let\@XParShapeNext = \X@ParShapeD
  35.     \else
  36.         \advance\X@ParShapeCountA by -1
  37.         \let\@XParShapeNext = \X@ParShapeC
  38.     \fi
  39.     \@XParShapeNext
  40. }
  41. \def\X@ParShapeD{%
  42.     \parshape = \X@ParShapeCountC\X@ParShapeCollect
  43. }
  44. \def\X@ParShapeC #1 #2 #3 #4 #5 {%
  45.     \message{\string\X@ParShapeC: #1, #2, #3, #4, #5}%
  46.     \X@ParShapeDimenA = #2% 
  47.     \X@ParShapeDimenB = #4% 
  48.     \DoLoop{\X@ParShapeCountB}{1}{1}{#1}%
  49.         {% 
  50.             \edef\X@ParShapeCollect{%
  51.                 \space
  52.                 \X@ParShapeCollect
  53.                 \the\X@ParShapeDimenA
  54.                 \space
  55.                 \the\X@ParShapeDimenB
  56.                 \space
  57.             }%
  58.             \advance\X@ParShapeCountC by 1
  59.             \advance\X@ParShapeDimenA by #3\relax
  60.             \advance\X@ParShapeDimenB by #5\relax
  61.         }%
  62.     \X@ParShapeB
  63. }
  64. \catcode`\@ = 12
  65.